package com.imooc.miaosha.system.data;

import com.imooc.miaosha.domian.User;

import java.io.Serializable;

/**
 * 模块描述: <br>
 * ()
 *
 * @Author: Mr. xyb
 * @Date: 2019/4/25 10:59
 * @since: 1.8.0
 * @version: 1.0.0
 */

public class UserThreadLocalContext implements Serializable {

    private static ThreadLocal<Long> userHolder = new ThreadLocal<>();

    public static void set(User user) {
        userHolder.set(user.getId());
    }

    public static Long get() {
        return userHolder.get();
    }

}
